- /* slosland.cpp by K.Tsuru */
- // function ID = 231 DRADIX
- /*****************************************************
- SLong class
- bit and oparator m & n
- It does not consider the sign and return a positive value.
- [Argorithm]
- 1.radix converion to SInteger with radix BRADIX
- 2.take bit and for each figure
- 3.reverse conversion
- ******************************************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
- SLong operator&(const SLong& m, const SLong& n){
- if( m.Sign(231) == 0) return m; // return 0.0;
- if( n.Sign(231) == 0) return n;
-
- SInteger M, N;
- //convert to binary
- // M = m.ConvToBin(); N = n.ConvToBin(); // version 2.20
- M = M.ConvToBin(m); N = N.ConvToBin(n); // version 2.20
- M = M & N;
- return M.ConvToDec(); //convert to decimal
- }
slosland.cpp : last modifiled at 2014/05/21 22:00:08(781 bytes)
created at 2017/10/07 10:26:50
The creation time of this html file is 2017/11/09 14:52:03 (Thu Nov 09 14:52:03 2017).